package com.chenqincheng.tracing;

import java.io.DataOutputStream;
import java.io.IOException;
import java.net.Socket;

/**
 * @author 陈钦成
 * Date: 2018/8/10 0:27
 * description:
 */
public class SocketTest {

    public static void main(String[] args) throws IOException {
        Socket socket = new Socket("127.0.0.1", 6688);
        socket.setSoTimeout(10000);
        DataOutputStream dos = new DataOutputStream(socket.getOutputStream());
        //发送注册信息
        byte[] register = ByteStringUtils.string2ByteArray("a10111223344556677880306");
        dos.write(register);
        dos.flush();
        System.out.println("发送完成！");
        // 用于保持连接，按任意键退出
        System.in.read();
    }

}
